package com.woniuxy.demo;

import io.swagger.annotations.ApiModelProperty;

/**
 * 返回接口，前端返回结果都用这个返回
 */
public class Result {
    @ApiModelProperty("返回前端状态码")
    private Integer code;
    @ApiModelProperty("返回前端文字描述")
    private String msg;
    @ApiModelProperty("返回前端数据")
    private Object data;

    public Integer getCode() {
        return code;
    }

    public Result setCode(Integer code) {
        this.code = code;
        return this;
    }

    public String getMsg() {
        return msg;
    }

    public Result setMsg(String msg) {
        this.msg = msg;

        return this;
    }

    public Object getData() {
        return data;
    }

    public Result setData(Object data) {
        this.data = data;
        return this;
    }

    public static Result newInstance() {
        Result re = new Result();
        re.setCode(200);
        re.setMsg("访问成功");
        return re;
    }


}
